<html>
<body>
<pre>
<?php

require_once("Bootstrap.php");

$gl = new gl();
$gl->createResource(500,500,200,200,200,0);
$gl->setViewPort(new ViewPort(0,0,500,500));
$gl->setMode(gl::Projection);
$gl->matrixLoad(gl::perspective(deg2rad(90),$gl->viewPort->getAspectRatio(),1,1000)); 
//$gl->matrixLoad(gl::orthographic(-10.0, 10.0, -10.0, 10.0, -10.0, 10.0));
$gl->setMode(gl::ModelView);
$gl->matrixLoad(gl::Identity());
$gl->translate3f(0,0,-300);
$gl->rotate4f(deg2rad(45),0,1,0);

$black = $gl->createColour(0,0,0,1);
$gl->drawTri(new cPoint3(0,50,0),new cPoint3(50,0,0),new cPoint3(0,-50,0),$black);
$gl->drawTri(new cPoint3(0,50,0),new cPoint3(-50,0,0),new cPoint3(0,-50,0),$black);

$red = $gl->createColour(255,0,0);
$blue = $gl->createColour(0,0,255);

$gl->drawLine(new cPoint3(-100,100,10),new cPoint3(100,-100,10),$red);
$gl->drawLine(new cPoint3(-100,-100,-10),new cPoint3(100,100,-10),$blue);

$greenAlpha = $gl->createColour(0,255,0,0.8);
$gl->drawTri(new cPoint3(-100,100,11),new cPoint3(-75,100,11),new cPoint3(-100,75,11),$greenAlpha);

$pinkAlpha = $gl->createColour(255,0,255,0.5);
$gl->drawQuad(new cPoint3(-10,60,-5),new cPoint3(10,60,-5),new cPoint3(10,40,-5),new cPoint3(-10,40,-5),$pinkAlpha);
$gl->drawQuad(new cPoint3(-10,-40,5),new cPoint3(-10,-60,5),new cPoint3(10,-60,5),new cPoint3(10,-40,5),$pinkAlpha);

/*$black = $gl->createColour(0,0,0,1);
$gl->drawLine(new cPoint3(0,0,0),new cPoint3(10,500,0),$black);
$gl->drawLine(new cPoint3(0,0,0),new cPoint3(500,10,0),$black);*/

$gl->render('out.png');
$gl->destroy();

?>
</pre>
<br/><br/>
<img src="out.png"/>
</body>
</html>